<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
		<title></title>
		<script src="../../../js/mui.min.js"></script>
		<script src="../../../js/world/SoulWorld/mian.js"></script>
		<link href="../../../css/mui.min.css" rel="stylesheet"/>
		<script src="../NowWorld/home/JQ.js"></script>
		<script type="text/javascript" charset="utf-8">
		  	mui.init();
			var buttonVar = "无";
		</script>
	</head>
	<body>
		<script>
			setTimeout(function(){
				if(plus.storage.getItem("OneDie") == null){
					alert("抱歉,您暂时不能进入魂界");
					window.location.href = '../../../index.html';
				}
				if(plus.storage.getItem("SoulForce")==null){
					plus.storage.setItem("SoulForce","1");
					plus.storage.setItem("SoulBelife","0");
					plus.storage.setItem("SoulStorgest","0");
					plus.storage.setItem("SoulFate","0");
					plus.storage.setItem("SoulLearn","0");
				}
				//plus.storage.clear();
				document.getElementById("SoulForce").innerHTML = plus.storage.getItem("SoulForce");
				document.getElementById("SoulBelife").innerHTML = plus.storage.getItem("SoulBelife");
				document.getElementById("SoulStorgest").innerHTML = plus.storage.getItem("SoulStorgest");
				document.getElementById("SoulFate").innerHTML = plus.storage.getItem("SoulFate");
				document.getElementById("SoulLearn").innerHTML = plus.storage.getItem("SoulLearn");
			},500);
		</script>
		<!-- 主界面菜单同时移动 -->
			<!-- 侧滑导航根容器 -->
			<div class="mui-off-canvas-wrap mui-draggable">
				<!-- 主页面容器 -->
				<div class="mui-inner-wrap">
					<!-- 菜单容器 -->
					<aside class="mui-off-canvas-left" id="offCanvasSide">
						<div class="mui-scroll-wrapper">
							<div class="mui-scroll">
								<!-- 菜单具体展示内容 -->
								<a href="../../../index.html"><button type="button" class="mui-btn mui-btn-blue mui-btn-block">回到主页</button></a>
								<a href=""><button type="button" class="mui-btn mui-btn-purple mui-btn-block">转生</button></a>
								<a href=""><button type="button" class="mui-btn mui-btn-grey mui-btn-block">灵魂</button></a>
								<a href=""><button type="button" class="mui-btn mui-btn-grey mui-btn-block">英灵</button></a>
								<a href=""><button type="button" class="mui-btn mui-btn-grey mui-btn-block">问天</button></a>
							</div>
						</div>
					</aside>
					<!-- 主页面标题 -->
					<header class="mui-bar mui-bar-nav">
						<a class="mui-icon mui-action-menu mui-icon-bars mui-pull-left" href="#offCanvasSide"></a>
						<h1 class="mui-title">转生</h1>
					</header>
					<!-- 主页面内容容器 -->
					<div class="mui-content mui-scroll-wrapper">
						<div class="mui-scroll">
							<!-- 主界面具体展示内容 -->
							<ul class="mui-table-view">
								<li class="mui-table-view-cell mui-collapse">
									<a class="mui-navigate-right" href="#">前往转生!</a>
									<div class="mui-collapse-content">
										<button type="button" class="mui-btn mui-btn-red mui-btn-block mui-btn-outlined" style="border-radius: 10%;">转生</button>
										<script>
											document.getElementsByTagName("button")[5].onclick = function(){
												if(buttonVar!="前往转生"){
													buttonVar = "前往转生";
													alert("请注意,您当前点了转生,如果您还活着,就会让你立即暴毙结算(再点击一次转生按钮转生)");
													document.getElementById("tip1").innerHTML = "部分属性升级后再转生才有效,不是随时生效";
													document.getElementById("tip2").innerHTML = "现在转生可获得魂力:" + SoulForceAdd();
												}else{
													buttonVar = "无";
													plus.storage.setItem("SoulForce",String(Number(plus.storage.getItem("SoulForce"))+SoulForceAdd()));
													plus.storage.setItem("YouDie","0");
													NowWorldClear();
													window.location.href = '../NowWorld/home.html';
												}
											}
										</script>
									</div>
								</li>
								
								<li class="mui-table-view-cell mui-collapse">
									<a class="mui-navigate-right" href="#">转生提升</a>
										<div class="mui-collapse-content">
										<div class="mui-row">
											<div class="mui-col-sm-6 mui-col-xs-6"><p>桎梏松动:<b id="SoulStorgest">0</b></p></div><div class="mui-col-sm-6 mui-col-xs-6"><p>气运增加:<b id="SoulFate">0</b></p></div>
											<div class="mui-col-sm-6 mui-col-xs-6"><p>学习能力:<b id="SoulLearn">0</b></p></div><div class="mui-col-sm-6 mui-col-xs-6"><p>暂无数据:<b id="SoulLearn">0</b></p></div>
											<div class="mui-col-sm-6 mui-col-xs-6"><button type="button" class="mui-btn mui-btn-green mui-btn-outlined mui-btn-block SongDong">桎梏松动</button></div>
											<div class="mui-col-sm-6 mui-col-xs-6"><button type="button" class="mui-btn mui-btn-green mui-btn-outlined mui-btn-block">气运增加</button></div>
											<div class="mui-col-sm-6 mui-col-xs-6"><button type="button" class="mui-btn mui-btn-green mui-btn-outlined mui-btn-block Learnd">学习能力</button></div>
											<div class="mui-col-sm-12 mui-col-xs-12">魂力:<code id="SoulForce">0</code></div>
											<div class="mui-col-sm-12 mui-col-xs-12">信仰:<code id="SoulBelife">0</code></div>
										</div>
										<script>
											$(".SongDong").click(function(){
												if(buttonVar!="桎梏松动"){
													document.getElementById("tip1").innerHTML = "桎梏松动:突破桎梏的概率增加,当前升级需要魂力:"+String(1+Number(plus.storage.getItem("SoulStorgest"))*2);
													buttonVar = "桎梏松动";
												}else{
													if(plus.storage.getItem("SoulForce")>=1+Number(plus.storage.getItem("SoulStorgest"))*2){
														plus.storage.setItem("SoulForce",String(Number(plus.storage.getItem("SoulForce"))-(1+Number(plus.storage.getItem("SoulStorgest"))*2)));
														plus.storage.setItem("SoulStorgest",String(Number(plus.storage.getItem("SoulStorgest"))+1));
														document.getElementById("SoulForce").innerHTML = plus.storage.getItem("SoulForce");
														document.getElementById("SoulStorgest").innerHTML = plus.storage.getItem("SoulStorgest");
														buttonVar = "无";
													}else{
														document.getElementById("tip1").innerHTML = "魂力不够啊大佬";
													}
												}
											});
											
											//少一个气运增加
											$(".Learnd").click(function(){
												if(buttonVar!="学习能力"){
													buttonVar = "学习能力";
													document.getElementById("tip1").innerHTML = "学习能力:增加锻造等技艺的经验倍率";
												}else{
													if(Number(plus.storage.getItem("SoulLearn"))>=1+Number(plus.storage.getItem("SoulLearn"))*5){
														plus.storage.setItem("SoulLearn",String(Number(plus.storage.getItem("SoulLearn"))-(1+Number(plus.storage.getItem("SoulLearn"))*5)));
														plus.storage.setItem("SoulLearn",String(Number(plus.storage.getItem("SoulLearn"))+1));
														document.getElementById("SoulLearn").innerHTML = plus.storage.getItem("SoulLearn");
														document.getElementById("SoulForce").innerHTML = plus.storage.getItem("SoulForce");
														buttonVar = "无";
													}else{
														document.getElementById("tip1").innerHTML = "魂力不够啊大佬";
													}
												}
											});
										</script>
									</div>
								</li>
							</ul>
						<h4>消息栏1:</h4>
							<p id="tip1">转生会清空属性,但是可以拥有更高的上限!</p>
						<h4>消息栏2:</h4>
							<p id="tip2"></p>
					</div>
			   	 <div class="mui-off-canvas-backdrop"></div>
				 
				</div>
			</div>
	</body>
</html>